FROM atlassian/confluence-server:6.15.4

USER root

COPY atlassian-agent.jar /opt/atlassian/confluence/
COPY mysql-connector-java-5.1.47-bin.jar /opt/atlassian/confluence/confluence/WEB-INF/lib
COPY mysql-connector-java-5.1.47.jar /opt/atlassian/confluence/confluence/WEB-INF/lib
COPY iptables.up.rules /etc/iptables.up.rules

RUN echo 'export CATALINA_OPTS="-javaagent:/opt/atlassian/confluence/atlassian-agent.jar ${CATALINA_OPTS}"' >> /opt/atlassian/confluence/bin/setenv.sh && \
    mkdir /usr/share/fonts/chinese /etc/network/if-pre-up.d -p
COPY iptables /etc/network/if-pre-up.d/iptables

VOLUME /usr/share/fonts/chinese

RUN apt-get update && apt-get install iptables vim inetutils-ping -y && chmod +x /etc/iptables.up.rules && chmod +x  /etc/network/if-pre-up.d/iptables